{% extends "topnav.html"%}

{% block title %}
结付支付
{% endblock %}

<body>
{% block body %}
<div class="container-fluid ">
    <div class="col-sm-2">
        <div class="menus">
            <div class="item">
                <div class="header" onclick="clickMe(this);">结付管理</div>
                <div class="content hide">
                    <a href="{{url_for('sm.insert')}}">--结付录入</a>
                    <a href="{{url_for('sm.payment')}}">--结付支付</a>
                    <a href="{{url_for('sm.query')}}">--结付查询</a>
                    <a>--使用说明</a>
                </div>
            </div>
            <div class="item">
                <div class="header" onclick="clickMe(this);">信息与沟通</div>
                <div class="content hide">
                    <a>--查询分析</a>
                    <a>--公告通知</a>
                    <a>--系统说明</a>
                    <a>--数据导出</a>
                </div>
            </div>
        </div>
    </div>
    <div class="col-sm-10">
        <div class="panel panel-info">
            <div class="panel-heading">
                <span class="glyphicon glyphicon-th-list" aria-hidden="true"></span>
                待支付商户结付单列表
                {% for message in get_flashed_messages() %}
                {{ message }}
                {% endfor %}
            </div>
            <div>
                <table class="table table-hover">
                    <thead>
                    <tr>
                        <th>结付单号</th>
                        <th>商户名称</th>
                        <th>开始日期</th>
                        <th>结束日期</th>
                        <th>结付金额</th>
                        <th>单据状态</th>
                        <th>操作</th>
                    </tr>
                    </thead>
                    <tbody>
                    {%for statement in statements%}
                    <tr>
                        <td>{{statement.id}}</td>
                        <td>{{statement.merchants.wechat_name}}</td>
                        <td>{{statement.since}}</td>
                        <td>{{statement.till}}</td>
                        <td>{{statement.statement_amount}}</td>
                        <td>{{statement.status}}</td>
                        <td>
                            <a class="btn btn-primary btn-xs"
                               href="{{url_for('sm.pay',statement_id=statement.id)}}">打印结付单</a>
                            <a class="btn btn-danger btn-xs"
                               href="{{url_for('sm.emergency',statement_id=statement.id)}}">紧急止付</a>
                        </td>
                    </tr>
                    {% endfor %}
                    </tbody>
                </table>
            </div>
            <nav aria-label="Page navigation">
                <ul class="pagination">
                    <li>
                        <a href="#" aria-label="Previous">
                            <span aria-hidden="true">&laquo;</span>
                        </a>
                    </li>
                    <li><a href="#">1</a></li>
                    <li><a href="#">2</a></li>
                    <li><a href="#">3</a></li>
                    <li><a href="#">4</a></li>
                    <li><a href="#">5</a></li>
                    <li>
                        <a href="#" aria-label="Next">
                            <span aria-hidden="true">&raquo;</span>
                        </a>
                    </li>
                </ul>
            </nav>
        </div>
    </div>
</div>
    <script type="text/javascript">
        function clickMe(self) {
            var hasHide = $(self).next().hasClass("hide");
            if (hasHide) {
                $(self).next().removeClass("hide");
            } else {
                $(self).next().addClass("hide");
            }
        }
    </script>
{% endblock %}
</div>
</body>